package com.tj.collection.db.dao.impl;
import com.fqgj.common.base.AbstractBaseMapper;
import com.tj.collection.db.dao.SwitchManageDao;
import com.tj.collection.db.entity.SwitchManageEntity;
import com.tj.collection.db.po.SwitchManageQueryPo;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* User: zl
* Date: 2023-11-23
* Time: 14:08:14.678
*/

@Repository
public class SwitchManageDaoImpl extends AbstractBaseMapper<SwitchManageEntity> implements SwitchManageDao {


    @Override
    public List<SwitchManageEntity> getListByPo(SwitchManageQueryPo switchManageQueryPo) {
        Map<String,Object> params = new HashMap<>();
        params.put("switchType",switchManageQueryPo.getSwitchType());
        params.put("appVersionName",switchManageQueryPo.getAppVersionName());
        params.put("channelCode",switchManageQueryPo.getChannelCode());
        params.put("pageSize",switchManageQueryPo.getPageSize());
        params.put("startIndex",switchManageQueryPo.getStartIndex());



        return this.getSqlSession().selectList(this.getStatement("selectListByParams"), params);

    }

    @Override
    public Integer selectCountByPo(SwitchManageQueryPo switchManageQueryPo) {
        Map<String,Object> params = new HashMap<>();
        params.put("switchType",switchManageQueryPo.getSwitchType());
        params.put("appVersionName",switchManageQueryPo.getAppVersionName());
        params.put("channelCode",switchManageQueryPo.getChannelCode());



        return (Integer) this.getSqlSession().selectOne(this.getStatement("selecCountByParams"), params);

    }

    @Override
    public List<String> selectPackageListByType(Integer switchType) {
        Map<String,Object> params = new HashMap<>();
        params.put("switchType",switchType);
        return this.getSqlSession().selectList(this.getStatement("selectPackageListByType"), params);
    }
}